<?php 
set_time_limit(0);
ini_set("memory_limit", "12M");
if(!isset($_SESSION)) 
{ 
session_start(); 
} 
unset($_SESSION['s_users']);
include 'checkdate.php';

$s_date = $_REQUEST['s_date'];
$winH = 520;
	if(isset($_REQUEST['winH'])) $winH = $_REQUEST['winH'];

if (isset($_REQUEST['s_date']) and isDateValid($s_date)== True) {
	include '../connection/connection.php';
	$searchdate = $_REQUEST['s_date'];
	
	
	$listSearch = mysql_query("SELECT l.logDate,l.logTime,c.szUser,l.iMode FROM caruser c,loglogin l where l.iUser= c.iUser and l.logDate='$searchdate'",$connection);
	$mylist = array(); 
	$index =0;
	while ($row = mysql_fetch_array($listSearch)){
		$index++;
		array_push($mylist, array($row[logDate],$row[logTime],$row[szUser],$row[iMode]));
					 ?>
					 <tr>
					 	<td width="25%"><?=$row[logDate]?></td>
					 	<td width="25%"><?=$row[logTime]?></td>
					 	<td width="25%"><?=$row[szUser]?></td>
					 	<td width="25%"  class="last"><?if ($row[iMode]==0){echo "로그인";}else if ($row[iMode]==1){echo "로그아웃";}?></td>
					 </tr> 
	<?php  }
					 if ($index>0 and $index<$winH/28) {
					 	foreach(range(0,$winH/28-$index) as $i){
					 		?>
					 		<tr>
						 	<td width="25%">&nbsp;</td>
						 	<td width="25%">&nbsp;</td>
						 	<td width="25%">&nbsp;</td>
						 	<td width="25%"  class="last">&nbsp;</td>
						 	</tr>
					 	<?php }
					 }
	$_SESSION['s_users'] = $mylist; 
	
	mysql_close($connection);
	  
}
?>

